home *** CD-ROM | disk | FTP | other *** search
/ Complete Linux / Complete Linux.iso / docs / system / mail / mailhand / metamail.z / metamail / bin / audiocompose next >
Encoding:
Text File  |  1992-03-10  |  1.8 KB  |  71 lines

  1. #!/bin/csh -f
  2. # Copyright (c) 1991 Bell Communications Research, Inc. (Bellcore)
  3. # Permission to use, copy, modify, and distribute this material 
  4. # for any purpose and without fee is hereby granted, provided 
  5. # that the above copyright notice and this permission notice 
  6. # appear in all copies, and that the name of Bellcore not be 
  7. # used in advertising or publicity pertaining to this 
  8. # material without the specific, prior written permission 
  9. # of an authorized representative of Bellcore.  BELLCORE 
  10. # MAKES NO REPRESENTATIONS ABOUT THE ACCURACY OR SUITABILITY 
  11. # OF THIS MATERIAL FOR ANY PURPOSE.  IT IS PROVIDED "AS IS", 
  12. # WITHOUT ANY EXPRESS OR IMPLIED WARRANTIES.
  13. #
  14.  
  15. # This is to make metamail/showaudio do playback on the speaker, not the phone.
  16. setenv AUDIOSPEAKERFORCE 1 
  17.  
  18. if (-d /usr/sony) then
  19.     set dev=/dev/sb0
  20. else
  21.     set dev=/dev/audio
  22. endif
  23.  
  24. set audiofile=$1
  25. if (-e $audiofile && ! -z $audiofile) goto whatnext
  26.  
  27. record:
  28. echo -n "Press RETURN when you are ready to start recording: "
  29. set foo = $<
  30.  
  31. # THIS IS UNBELIEVABLY GRUBBY
  32. onintr cleanup
  33. if (! $?RECORD_AUDIO) then
  34.     (/bin/cat < $dev > $audiofile) &
  35. else
  36.     ($RECORD_AUDIO > $audiofile) &
  37. endif
  38. jobs -l > /tmp/AUDCAT.$$
  39. set foo=`/bin/cat /tmp/AUDCAT.$$`
  40. /bin/rm /tmp/AUDCAT.$$
  41. set PID=$foo[2]
  42. echo -n "press RETURN when you are done recording: "
  43. set foo=$<
  44. echo One moment please...
  45. /bin/sleep 1
  46. echo -n Killing recording job...
  47. /bin/kill -9 $PID >& /dev/null
  48.  
  49. whatnext:
  50. echo ""
  51. echo "What do you want to do?"
  52. echo ""
  53. echo "1 -- Listen to recorded message"
  54. echo "2 -- Replace with a new recording"
  55. echo "3 -- All Done, Quit"
  56. set which = $<
  57.     switch ($which)
  58.         case 1:
  59.           cat $audiofile > $dev
  60.           breaksw
  61.         case 2:
  62.           goto record
  63.         case 3:
  64.           exit
  65.     endsw
  66. goto whatnext
  67. exit 0
  68. cleanup:
  69. kill -9 $PID >& /dev/null
  70.